package com.stan.core.vo;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class Task {
    public static String TASK_CREATED = "TASK_CREATED";
    public static String TASK_STARTED = "TASK_STARTED";
    public static String TASK_FINISHED = "TASK_FINISHED";

    private String taskId;
    private String taskName;
    private String taskParams;
    private String createTime;
    private String startTime;
    private String finishTime;
    private String taskType;
    private String taskStatus;

    /**
     * 以JSONObject的形式读取taskParams参数
     * @return
     */
    public JSONObject getTaskParamsAsAJsonObject(){
        JSONObject result = null;
        result = JSONObject.parseObject(taskParams);
        return result;
    }

}
